#ifndef __SERVER_CONN_H__
#define __SERVER_CONN_H__

#include "event.h"

typedef struct conn_tag
{
    int fd;
	int index;
    struct sockaddr_in cliaddr;
    struct bufferevent* bufev;
    struct evbuffer* evbuf;

} conn_t;

conn_t* connection_new();
void connection_free(conn_t* conn);
void connection_accept(int sockfd, short event, void* data);
void connection_input(struct bufferevent* bufev, void* data);
void connection_output(struct bufferevent* bufev, void* data);
void connection_error(struct bufferevent* bufev, short what, void* data);


#endif
